<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script>

function name(){
	if(document.form1.nome.value == ""){
		return false;
	}
	return true;
}
function tipo(){
	if (document.form1.tipo.selectedIndex==0){
		return false;
	}
	return true;
}

function marca(){

	if (document.form1.marca.selectedIndex==0){
		return false;
	}
	return true;
}

function pais(){
	if (document.form1.pais.selectedIndex==0){
		return false;
	}	
	return true;
}

function message(){
	if( name()|| tipo() || marca()|| pais() ){
		document.form1.submit();
	}
	else{
		alert("Pelo menos um campo deve ser preenchido.");
	}
}
</script>

<%@include file="../../_header.jsp" %>
  <div class="style2" id="conteudo">
    <div id="conteudo1"></div>
    <p>&nbsp;</p>
    <div id="conteudoTabela">
      <form id="form1" name="form1" method="post" action="RotuloServlet">
      <input type="hidden" name="comando" value="consultar" />
        <table width="446" border="0" align="center" cellpadding="5" cellspacing="0">
          <tr>
            <td colspan="2"><div align="center" class="style9"><span class="style8">Consultar R&oacutetulos </span></div></td>
          </tr>
          <tr>
            <td width="206"><div align="left" class="style9"><span class="style6">Nome:</span></div></td>
            <td width="220"><span class="style9">
              <label>
              <input type="text" name="nome" id="nome" />
              </label>
            </span></td>
          </tr>
          <tr>
            <td><div align="left" class="style9"><span class="style6">Tipo:</span></div></td>
            <td><span class="style9">
              <label>
              <select name="tipo" id="tipo">
              <option value="0"> </option>
              <c:forEach var="item" items="${listaTipos}">
					<option value="<c:out value='${item.codTipo}'/>"><c:out
					value="${item.tipo}"/></option>
			  </c:forEach>
              </select>
              </label>
            </span></td>
          </tr>
          <tr>
            <td><div align="left" class="style9"><span class="style6">Marca:</span></div></td>
            <td><span class="style9">
              <select name="marca" id="marca">
              <option value="0"> </option>
              <c:forEach var="item" items="${listaMarcas}">
					<option value="<c:out value='${item.codMarca}'/>"><c:out
					value="${item.marca}"/></option>
			</c:forEach>
              </select>
            </span> </td>
          </tr>
          <tr>
            <td><div align="left" class="style9"><span class="style6">Pa&iacutes de Origem:</span></div></td>
            <td><span class="style9">
              <label>
              <select name="pais" id="pais">
              <option value="0"> </option>
              <c:forEach var="item" items="${listaPaises}">
					<option value="<c:out value='${item.codPais}'/>"><c:out
					value="${item.pais}"/></option>
			  </c:forEach>
              </select>
              </label>
            </span></td>
          </tr>
          <tr>
            <td colspan="2"><span class="style9">
                <label>
                <div align="center" class="style9">
                  <input type="button" name="consultar" id="consultar" onclick="message()" value="Consultar" />
                </div>
                </label>
              </span></td>
          </tr>
        </table>
      </form>
      <p>&nbsp;</p>
    </div>
    <p>&nbsp;</p>
  </div>
  <%@include file="../../_footer.jsp" %>

